package gases.as3.librarys.core.net.socket
{
	import flash.net.ObjectEncoding;

	public class AMF3Socket extends BaseSocket
	{
		public function AMF3Socket(host:String= null, port:int= 0, securityPort:int= 0)
		{
			super(host, port, securityPort);
		}
		
		override protected function initialize():void
		{
			super.initialize();
			_socket.objectEncoding = ObjectEncoding.AMF3;
		}
		
		override protected function resolveSocketData():void
		{
			
		}
		
		override public function writeInSocket(obj:Object, isSend:Boolean=true):void
		{
			if(!obj)
				return;
			if(connected)
			{
				_socket.writeObject(obj);
				if(isSend)
					send();
			}
			else
			{
				_buffers.push(obj);
			}
		}
	}
}